import { dev } from '$app/environment';
// import { version } from '../../package.json';

// export const APP_NAME = 'Open WebUI';
export const APP_NAME = '智慧云瀚';
// export const WEBUI_BASE_URL = dev ? `http://${location.hostname}:8080` : ``;
// export const WEBUI_BASE_URL = dev ? `http://192.168.0.108:10004` : `http://localllm.fortune-data.com:9080`;
// export const WEBUI_IAMGE_BASE_URL = dev ? `http://192.168.0.108:7862` : `http://localllm.fortune-data.com:9080`;

export const WEBUI_BASE_URL = dev ? `http://127.0.0.1:8888` : ``;
export const WEBUI_IAMGE_BASE_URL = dev ? `http://127.0.0.1:8888` : ``;

export const WEBUI_API_BASE_URL = `${WEBUI_BASE_URL}/api/v1`;

export const LITELLM_API_BASE_URL = `${WEBUI_BASE_URL}/litellm/api`;
export const OLLAMA_API_BASE_URL = `${WEBUI_BASE_URL}/ollama`;
export const OPENAI_API_BASE_URL = `${WEBUI_BASE_URL}/openai/api`;
export const AUDIO_API_BASE_URL = `${WEBUI_BASE_URL}/audio/api/v1`;
export const IMAGES_API_BASE_URL = `${WEBUI_IAMGE_BASE_URL}/images/api/v1`;
export const RAG_API_BASE_URL = `${WEBUI_BASE_URL}/rag/api/v1`;

export const WEBUI_VERSION = APP_VERSION;
export const REQUIRED_OLLAMA_VERSION = '0.1.16';

export const SUPPORTED_FILE_TYPE = [
	'application/epub+zip',
	'application/pdf',
	'text/plain',
	'text/csv',
	'text/xml',
	'text/html',
	'text/x-python',
	'text/css',
	'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
	'application/octet-stream',
	'application/x-javascript',
	'text/markdown',
	'audio/mpeg',
	'audio/wav'
];

export const SUPPORTED_FILE_EXTENSIONS = [
	'md',
	'rst',
	'go',
	'py',
	'java',
	'sh',
	'bat',
	'ps1',
	'cmd',
	'js',
	'ts',
	'css',
	'cpp',
	'hpp',
	'h',
	'c',
	'cs',
	'htm',
	'html',
	'sql',
	'log',
	'ini',
	'pl',
	'pm',
	'r',
	'dart',
	'dockerfile',
	'env',
	'php',
	'hs',
	'hsc',
	'lua',
	'nginxconf',
	'conf',
	'm',
	'mm',
	'plsql',
	'perl',
	'rb',
	'rs',
	'db2',
	'scala',
	'bash',
	'swift',
	'vue',
	'svelte',
	'doc',
	'docx',
	'pdf',
	'csv',
	'txt',
	'xls',
	'xlsx'
];

// Source: https://kit.svelte.dev/docs/modules#$env-static-public
// This feature, akin to $env/static/private, exclusively incorporates environment variables
// that are prefixed with config.kit.env.publicPrefix (usually set to PUBLIC_).
// Consequently, these variables can be securely exposed to client-side code.

export const DownloadableModels = [
	{ id: 'deepseek-r1:1.5b', name: 'deepseek-r1:1.5b (1.1G)' },
	{ id: 'deepseek-r1:7b', name: 'deepseek-r1:7b (4.7G)' },
	{ id: 'deepseek-r1:8b', name: 'deepseek-r1:8b (4.9G)' },
	{ id: 'deepseek-r1:14b', name: 'deepseek-r1:14b (9.0G)' },
	{ id: 'deepseek-r1:32b', name: 'deepseek-r1:32b (20G)' },
	{ id: 'deepseek-r1:70b', name: 'deepseek-r1:70b (43G)' },
	{
		id: 'phi3:3.8b',
		name: 'phi3:3.8b (2.3GB)'
	},
	{
		id: 'phi3:14b',
		name: 'phi3:14b (7.9GB)'
	},
	{
		id: 'wizardlm2:7b',
		name: 'wizardlm2:7b (4.1GB)'
	},
	{
		id: 'mistral:7b',
		name: 'mistral:7b (4.1GB)'
	},
	{
		id: 'gemma:7b',
		name: 'gemma:7b (5.0GB)'
	},
	{
		id: 'codegemma:7b',
		name: 'codegemma:7b (5.0GB)'
	},
	{
		id: 'codeqwen:7b',
		name: 'codeqwen:7b (4.2GB)'
	},
	{
		id: 'yi:6b',
		name: 'yi:6b (3.5GB)'
	},
	{
		id: 'yi:34b',
		name: 'yi:34b (19GB)'
	},
	{
		id: 'llama3:8b',
		name: 'llama3:8b (4.7GB)'
	},
	{
		id: 'llama3:70b',
		name: 'llama3:70b (40GB)'
	},
	{
		id: 'qwen:0.5b',
		name: 'qwen:0.5b (395MB)'
	},
	{
		id: 'qwen:7b',
		name: 'qwen:7b (4.5GB)'
	},
	{
		id: 'qwen:32b',
		name: 'qwen:32b (18GB)'
	},
	{
		id: 'qwen:72b',
		name: 'qwen:72b (41GB)'
	},
	{
		id: 'llava:7b',
		name: 'llava:7b (4.7GB) (用于识别图像)'
	},
	{
		id: 'llava:13b',
		name: 'llava:13b (8.0GB) (用于识别图像)'
	},
	{ id: 'gemma2:9b', name: 'gemma2:9b (5.4GB)' },
	{ id: 'gemma2:27b', name: 'gemma2:27b (16GB)' },
	{ id: 'qwen2:0.5b', name: 'qwen2:0.5b (352MB)' },
	{ id: 'qwen2:1.5b', name: 'qwen2:1.5b (935MB)' },
	{ id: 'qwen2:7b', name: 'qwen2:7b (4.4GB)' },
	{ id: 'qwen2:72b', name: 'qwen2:72b (41GB)' },
	{ id: 'llama3.1:8b', name: 'llama3.1:8b (4.7GB)' },
	{ id: 'llama3.1:70b', name: 'llama3.1:70b (40GB)' },
	{ id: 'llama3.1:405b', name: 'llama3.1:405b (229GB)' },
	{ id: 'mistral-nemo:12b', name: 'mistral-nemo:12b (7.1GB)' },
	{ id: 'mistral-large:123b', name: 'mistral-large:123b (69GB)' },
	{ id: 'deepseek-coder-v2:16b', name: 'deepseek-coder-v2:16b (8.9GB)' },
	{ id: 'deepseek-coder-v2:236b', name: 'deepseek-coder-v2:236b (133GB)' },
	{ id: 'phi3.5:3.8b', name: 'phi3.5:3.8b (2.2GB)' },
	{ id: 'qwen2-math:1.5b', name: 'qwen2-math:1.5b (935MB)' },
	{ id: 'qwen2-math:7b', name: 'qwen2-math:7b (4.4GB)' },
	{ id: 'qwen2-math:72b', name: 'qwen2-math:72b (41GB)' }
];
